package com.qww.exec12;

public class Stem extends Root {

    Stem() {
        System.out.println("Stem constructor");
    }

    public void dispose() {
        System.out.println("Stem dispose");
        super.dispose();
    }

    public static void main(String[] args) {
        Stem stem = new Stem();
        try {
            // ...
        }finally {
           stem.dispose();
        }
    }
}
/* 运行结果
Component1 constructor
Component2 constructor
Component3 constructor
Root constructor
Stem constructor
Stem dispose
Root dispose
Component3 dispose
Component2 dispose
Component1 dispose
 */
